﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EventReminder.Server
{
    class EventProcessorBuilder
    {
        IEventProcessor _topLink;

        public EventProcessorBuilder()
        {

        }

        public void AddLink(IEventProcessor newTopLink)
        {
            if (_topLink != null)
            {
                newTopLink.NextLink = _topLink;
            }

            _topLink = newTopLink;
        }

        public IEventProcessor GetTopLinkOfChain()
        {
            return _topLink;
        }

        public void ClearChain()
        {
            _topLink = null;
        }
    }
}
